import Vue from 'vue'

import 'normalize.css/normalize.css' // A modern alternative to CSS resets

import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import locale from 'element-ui/lib/locale/lang/zh-CN' // lang i18n

import '@/styles/index.scss' // global css

//vue富文本样式引用
import 'quill/dist/quill.core.css'
import 'quill/dist/quill.snow.css'
import 'quill/dist/quill.bubble.css'

import App from './App'
import store from './store'
import router from './router'
// import { default as Adal } from 'vue-adal'
import authentication from '@/utils/authentication'
import authService from '@/utils/authservice'
import '@/icons' // icon
import '@/permission' // permission control

/**
 * If you don't want to use mock-server
 * you want to use MockJs for mock api
 * you can execute: mockXHR()
 *
 * Currently MockJs will be used in the production environment,
 * please remove it before going online! ! !
 */
// import { mockXHR } from '../mock'
// if (process.env.NODE_ENV === 'production') {
//   mockXHR()
// }

// set ElementUI lang to zh-cn
Vue.use(ElementUI, { locale })
// Vue.prototype.$AuthService = new AuthService()
// use ADAL to authentication
// Vue.use(Adal, {
//   config: {
//     tenant: 'qdlspsp.onmicrosoft.com',
//     clientId: 'f333fc96-8cae-44c4-a943-599470fef28e',
//     redirectUri: 'http://localhost:9528',
//     cacheLocation: 'localStorage'
//   },
//   requireAuthOnInitialize: true,
//   router: router
// })

Vue.config.productionTip = false
// Init adal authentication - then create Vue app.
// authService.initialize().then(_ => {
/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  store,
  render: h => h(App)
})
// })
// new Vue({
//   el: '#app',
//   router,
//   store,
//   render: h => h(App)
// })
